{% include 'front/header1.html' %}
<link rel="stylesheet" href="/resource/front/css/mobile/y-login.css" />
<!--<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0" />
		<meta content="telephone=no" name="format-detection" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<link rel="stylesheet" href="/resource/front/css/mobile/style.min.css">
		<link rel="stylesheet" href="/resource/front/css/mobile/y-login.css" />
		<link rel="stylesheet" href="/resource/front/css/mobile/mui.css" />
		<link rel="stylesheet" href="/public/resource/front/css/mobile/style.csss" />
		<title>登录</title>-->
<style>
	body {
		margin: 0;
		padding: 0;
		background: #fff !important;
		position: relative;
		height: 100%;
	}
	
	.true-wrap {
		width: 7.36rem;
		text-align: center;
		height: 5.76rem;
		display: none;
		background: #fff;
		z-index: 1001;
		/*position: fixed;*/
		position: absolute;
		left: 50%;
		top: 44%;
		/*transform: translateY(-50%);*/
		transform: translate(-50%, -50%);
	}
	
	.rigth-top {
		width: 0.69rem;
		height: 0.69rem;
		position: absolute;
		right: -.3rem;
		top: -.3rem;
	}
	
	.login-true {
		width: 1.11rem;
		height: 1.11rem;
		margin: 0.72rem auto 0;
	}
	
	.login-true-text {
		font-size: 0.48rem;
		color: rgba(51, 51, 51, 1);
		margin-top: 0.88rem;
	}
	
	.go-home {
		width: 5.33rem;
		height: 1.07rem;
		background: rgba(254, 225, 81, 1);
		border-radius: 0.07rem;
		font-size: 0.4rem;
		color: rgba(51, 51, 51, 1);
		display: flex;
		justify-content: center;
		align-items: center;
		margin: .79rem auto;
	}
	
	.login-wrap input[type='password'] {
		line-height: 21px;
		width: 64%;
		height: 22px;
		margin-bottom: 0px;
		padding: 0px;
		-webkit-user-select: text;
		border: none;
		border-radius: 3px;
		outline: none;
		background-color: #fff;
		-webkit-appearance: none;
	}
	input {
		width: 75%;
	}
</style>
</head>

<body>
	<div class="login-wrap" style="max-width: 600px; height: 100%; margin:0 auto ;position: relative;background: #fff !important;">
		<div class="login-banner">
			<img src="/resource/front/images/forward/05072.png" alt="">
		</div>
		<div>
			<div class="login-title">
				<span class="">账号登录</span>
			</div>
			<!-- 登录 -->
			<div class="login-bottom-wrap div-tab" style="">
				<div class="phone input-wrap" style="display: flex; align-items: center;">
					<span>手机:</span>
					<input type="text" id="phone" placeholder="请输入您的手机号码" style="width: 75%; margin-bottom: 0;">
				</div>
				<div class="phonea input-wrap" style="line-height: .95rem; height: 100%;">
					<span style="margin-left: 0.7rem;">密码:</span>
					<input type="password" id="code" placeholder="请输入密码" style="width: 130px;margin-left: 15px;">
				</div>
				
				<button class="res-q">登录</button>
				<p class="go-login login"> 验证码登录</p>
			</div>
			<!-- 登录 -->

		</div>

	</div>
	<div class="true-wrap">
		<img src="/resource/front/images/forward/delete.png" alt="" class="rigth-top">
		<img src="/resource/front/images/forward/true.png" alt="" class="login-true">
		<p class="login-true-text">登录成功</p>
		<div class="go-home">返回详情页</div>
	</div>
	<div class="js_dialog" style="opacity: 1;display: none; ">
		<div class="weui-mask"></div>
	</div>
</body>
<script type="text/javascript" src="/resource/front/js/jquery.min.js"></script>
<script type="text/javascript" src="/resource/front/css/mobile/mui.js"></script>
<script type="text/javascript" src="/resource/front/css/mobile/jQuery.md5.js"></script>
<script type="text/javascript" src="/resource/front/css/mobile/ykp.js"></script>
<script>
	mui.ready(function() {
		this.init()
		this.countdown = 59; //倒计时
		this.time = "";

		$('.close').on('click', function() {
			$('.true-wrap').hide();
			$('.js_dialog').hide();
		})

		this.goAvInfo();
		this.goLogin()
	})

	function goAvInfo() {
		$('.go-home').click(function() {
			if(ykp.getLocalStorage('suspension')){
					window.location.href = 'suspension_mobile?data=' + ykp.getLocalStorage('suspension');
				}else{
					window.location.href = 'advinfo_mobile' + ykp.getLocalStorage('avinfo');
				}
//			window.location.href = 'advInfo_mobile' + ykp.getLocalStorage('avinfo');
		})
	}
	
	function goLogin() {
		$('.go-login').click(function() {
			window.location.href = "login"
		})
	}

	function init() {
		$('.res-q').click(function() {

			if(!$('#phone').val()) {
				mui.toast("请输入手机号");
				return false;
			}

			if(!$('#code').val()) {
				mui.toast("请输入密码");
				return false;
			}
			ykp.doAjax({
				url: "/api/login/login",
				method: "post",
				data: {
					user_name: $('#phone').val(),
					type: 1,
					password: $('#code').val()
				},
				success: function(res) {
					if(res.code == 200){
						$('.true-wrap').show();
						$('.js_dialog').show();
						mui.toast("登录成功");
						ykp.setLocalStorage("userInfo", JSON.stringify(res.data));
					}else{
						mui.toast(res.msg);
					}
					
				}
			})
		})
	}
</script>

</html>